<?php
if (!defined('ABSPATH')) {
    exit;
}
?>

<div class="nx-custom-sort-list" data-nx-custom-sort-page-id="<?php echo esc_attr(get_the_ID()); ?>">
    <?php while ($query->have_posts()) : $query->the_post(); ?>
        <div class="nx-custom-sort-item">
            <h3><?php the_title(); ?></h3>
            <?php if (has_post_thumbnail()) : ?>
                <?php the_post_thumbnail('thumbnail'); ?>
            <?php endif; ?>
            <?php if (get_post_type() === 'product') : ?>
                <p><?php echo wc_price(wc_get_product()->get_price()); ?></p>
            <?php endif; ?>
        </div>
    <?php endwhile; wp_reset_postdata(); ?>
</div>
